# coding=utf-8
# 代码文件：chapter5/ch5.2.3.py

import xlwings as xw

app = xw.App(visible=True, add_book=False)  # 可见方式运行文件
f = r'data/北京房价数据.xlsx'

wb = app.books.open(f)
sheet1 = wb.sheets[0]

rng = sheet1.range('A1').current_region

rng.api.AutoFilter(Field := 6,              # 对第6列进行过滤处理
                   Criteria1="=东城",
                   Operator=2,              # 2是VBA常量xlOr
                   Criteria2="=西城", )

rng.api.AutoFilter(Field=3, Criteria1=">120")
